package com.mingqijia.gassafety.webserver.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.mingqijia.gassafety.db.entity.BusinessNotice;
import com.mingqijia.gassafety.shared.utils.commonUtils.PageUtil;
import com.mingqijia.gassafety.webserver.request.BrowserNotifyReason;
import com.mingqijia.gassafety.webserver.request.BusinessNoticeRequest;
import com.mingqijia.gassafety.webserver.response.BusinessNoticeResponse;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 业务通知规则表 服务类
 * </p>
 *
 * @author wanghai
 * @since 2022-04-28
 */
public interface BusinessNoticeService extends IService<BusinessNotice> {
    /**
     * 查询列表
     * @param paramName
     * @param paramCode
     * @param page
     * @param pageSize
     * @return
     */
    PageUtil<BusinessNoticeResponse> getList(String paramName, String paramCode, Integer page, Integer pageSize);

    /**
     * 新增
     * @param req
     */
    void create(BusinessNoticeRequest req);

    /**
     * 查看
     * @param req
     * @return
     */
    BusinessNoticeResponse detail(Map<String, String> req);

    /**
     * 编辑
     * @param req
     * @param spId
     */
    void edit(BusinessNoticeRequest req, String spId, BusinessNotice businessNotice);

    /**
     * 删除
     * @param id
     */
    void del(Integer id);

    /**
     * 判断规格是否推送
     * @param reason
     * @param spId
     * @return
     */
    Map<String,Object> isSend(BrowserNotifyReason reason, String spId);

    /**
     * 根据企业复制通知配置
     * */
    void duplicateNotices(String spId);

    BusinessNotice getByCode(String code, String spId);

    Boolean switchValueByCode(String code, String spId);

    /**
     * 查询配置
     *
     * @return
     */
    List<BusinessNotice> selectParamList(Map<String, Object> params);


    /**
     * 查询设备厂商
     */
    Map<String,String> EquipmentManufacturerMap();

    /**
     * 根据code查询所有家的配置
     *
     * @return
     */
    List<BusinessNotice> selectParamCode(String paramCode);

    /**
     * 获取企业的服务套餐开关
     * @param spId
     * @return
     */
    Boolean getServicePackageSwitch(String spId);
}
